home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / FixMath.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  2.8 KB  |  111 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        FixMath.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __FIXMATH__
  18. #define __FIXMATH__
  19.  
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. /*    #include <ConditionalMacros.h>                                */
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30. #if GENERATINGPOWERPC
  31. #pragma options align=mac68k
  32. #endif
  33.  
  34. #ifdef __CFM68K__
  35. #pragma lib_export on
  36. #endif
  37.  
  38.  
  39. enum {
  40.     fixed1                        = 0x00010000L,
  41.     fract1                        = 0x40000000L,
  42.     positiveInfinity            = 0x7FFFFFFFL,
  43.     negativeInfinity            = 0x80000000L
  44. };
  45.  
  46. extern pascal Fract Fix2Frac(Fixed x)
  47.  ONEWORDINLINE(0xA841);
  48. extern pascal long Fix2Long(Fixed x)
  49.  ONEWORDINLINE(0xA840);
  50. extern pascal Fixed Long2Fix(long x)
  51.  ONEWORDINLINE(0xA83F);
  52. extern pascal Fixed Frac2Fix(Fract x)
  53.  ONEWORDINLINE(0xA842);
  54. extern pascal Fract FracMul(Fract x, Fract y)
  55.  ONEWORDINLINE(0xA84A);
  56. extern pascal Fixed FixDiv(Fixed x, Fixed y)
  57.  ONEWORDINLINE(0xA84D);
  58. extern pascal Fract FracDiv(Fract x, Fract y)
  59.  ONEWORDINLINE(0xA84B);
  60. extern pascal Fract FracSqrt(Fract x)
  61.  ONEWORDINLINE(0xA849);
  62. extern pascal Fract FracSin(Fixed x)
  63.  ONEWORDINLINE(0xA848);
  64. extern pascal Fract FracCos(Fixed x)
  65.  ONEWORDINLINE(0xA847);
  66. extern pascal Fixed FixATan2(long x, long y)
  67.  ONEWORDINLINE(0xA818);
  68. #if GENERATINGPOWERPC
  69. extern WidePtr WideAdd(wide *target, const wide *source);
  70. extern short WideCompare(const wide *target, const wide *source);
  71. extern WidePtr WideNegate(wide *target);
  72. extern WidePtr WideShift(wide *target, long shift);
  73. extern unsigned long WideSquareRoot(const wide *source);
  74. extern WidePtr WideSubtract(wide *target, const wide *source);
  75. extern WidePtr WideMultiply(long multiplicand, long multiplier, wide *target);
  76. /* returns the quotient */
  77. extern long WideDivide(const wide *dividend, long divisor, long *remainder);
  78. /* quotient replaces dividend */
  79. extern WidePtr WideWideDivide(wide *dividend, long divisor, long *remainder);
  80. extern WidePtr WideBitShift(wide *src, long shift);
  81. #endif
  82. #if GENERATING68K && !GENERATING68881
  83. extern pascal double_t Frac2X(Fract x)
  84.  ONEWORDINLINE(0xA845);
  85. extern pascal double_t Fix2X(Fixed x)
  86.  ONEWORDINLINE(0xA843);
  87. extern pascal Fixed X2Fix(double_t x)
  88.  ONEWORDINLINE(0xA844);
  89. extern pascal Fract X2Frac(double_t x)
  90.  ONEWORDINLINE(0xA846);
  91. #else
  92. extern pascal double_t Frac2X(Fract x);
  93. extern pascal double_t Fix2X(Fixed x);
  94. extern pascal Fixed X2Fix(double_t x);
  95. extern pascal Fract X2Frac(double_t x);
  96. #endif
  97.  
  98. #ifdef __CFM68K__
  99. #pragma lib_export off
  100. #endif
  101.  
  102. #if GENERATINGPOWERPC
  103. #pragma options align=reset
  104. #endif
  105.  
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109.  
  110. #endif /* __FIXMATH__ */
  111.